<?php

defined('SYSPATH') or die('No direct access allowed.');

if (!Route::cache()) {
    Route::set('purchase', 'purchase(/<action>)(/<id>)(/<token>)'
            )
            ->defaults(array(
                'controller' => 'purchase',
                'action' => 'addnew',
    ));
    //打印采购单。
    Route::set('printpurchase', 'printpurchase(/<action>(/<id>))')
            ->defaults(array(
                'controller' => 'printpurchase',
                'action' => 'purchaseprint',
    ));
    Route::set('advancewarning', 'advancewarning(/<action>(/<id>))')
            ->defaults(array(
                'controller' => 'advancewarning',
                'action' => 'index',
    ));


    Route::set('purchases/paydetail', 'purchases/paydetail(/<action>(/<id>))')
            ->defaults(array(
                'directory' => 'purchases',
                'controller' => 'paydetail',
                'action' => 'paydetail',
    ));
    Route::set('warning', 'warning(/<action>(/<id>))')
            ->defaults(array(
                'controller' => 'warning',
                'action' => 'index',
    ));

    Route::set('count', 'count(/<action>(/<id>))')
            ->defaults(array(
                'controller' => 'count',
                'action' => 'daysale',
    ));
    Route::set('purchases/pay', 'purchases/pay(/<action>)(/<id>)(/<token>)'
            )
            ->defaults(array(
                'directory' => 'purchases',
                'controller' => 'pay',
                'action' => 'purchasepay',
    ));

    Route::set('purchases/expediting', 'purchases/expediting(/<action>)(/<id>)(/<token>)'
            )
            ->defaults(array(
                'directory' => 'purchases',
                'controller' => 'expediting',
                'action' => 'stockchase',
    ));

    Route::set('purchases/selectpurchase', 'purchases/selectpurchase(/<action>)(/<id>)(/<token>)'
            )
            ->defaults(array(
                'directory' => 'purchases',
                'controller' => 'selectpurchase',
                'action' => 'index',
    ));
    Route::set('purchases/select', 'purchases/select(/<action>)(/<id>)(/<token>)'
            )
            ->defaults(array(
                'directory' => 'purchases',
                'controller' => 'select',
                'action' => 'purchaseindex',
    ));

    Route::set('purchases/improper', 'purchases/improper(/<action>)(/<id>)(/<token>)'
            )
            ->defaults(array(
                'directory' => 'purchases',
                'controller' => 'improper',
                'action' => 'index',
    ));

    Route::set('provider', 'provider(/<action>)(/<id>)(/<token>)'
            )
            ->defaults(array(
                'controller' => 'provider',
                'action' => 'index',
    ));
    //yuqing
    Route::set('outland', 'outland(/<action>)(/<id>)(/<token>)'
            )
            ->defaults(array(
                'controller' => 'outland',
                'action' => 'outlandorder',
    ));
    //yuqing
    Route::set('checkpurchaseorder', 'checkpurchaseorder(/<action>)(/<id>)(/<token>)'
            )
            ->defaults(array(
                'controller' => 'checkpurchaseorder',
                'action' => 'index',
    ));
}
//权限设置

ACL::set('采购模块', array(
    'purchase_add_for_supplier' => array(
        'title' => __('根据供应商创建预约单'),
        'restrict access' => TRUE,
        'description' => '',
    ),
    'purchase_add_for_sku' => array(
        'title' => __('根据SKU创建预约单'),
        'restrict access' => TRUE,
        'description' => '',
    ),
    'purchase_order_select' => array(
        'title' => __('预约单查询'),
        'restrict access' => TRUE,
        'description' => '',
    ),
    'purchase_order_del' => array(
        'title' => __('预约单取消'),
        'restrict access' => TRUE,
        'description' => '',
    ),
    'Printpurchase' => array(
        'title' => __('预约单打印'),
        'restrict access' => TRUE,
        'description' => '',
    ),
    'checkpurchaseorder_index' => array(
        'title' => __('供应商退货审批查询'),
        'restrict access' => TRUE,
        'description' => '',
    ),
    'checkpurchaseorder_return_application' => array(
        'title' => __('供应商退货申请'),
        'restrict access' => TRUE,
        'description' => '',
    ),
    'checkpurchaseorder_supplychain_check' => array(
        'title' => __('供应商退货供应链审批'),
        'restrict access' => TRUE,
        'description' => '',
    ),
    'checkpurchaseorder_finance_check' => array(
        'title' => __('供应商退货财务审批'),
        'restrict access' => TRUE,
        'description' => '',
    ),
    'checkpurchaseorder_warehouse_check' => array(
        'title' => __('供应商退货仓库审批'),
        'restrict access' => TRUE,
        'description' => '',
    ),
));
